package com.bwie.house.controller;

import com.bwie.common.utils.R;
import com.bwie.house.config.OssUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author 张泽宇
 * @Date 2022/4/22 21:42
 * @ProjectName: [search_house]
 * @Package: [com.bwie.house.controller]
 * @ClassName: []
 */
@RestController
@RequestMapping("house/oss")
public class OssController {

    @Autowired
    private OssUtils ossUtils;


    /**
     * 文件上传
    * @author 張泽宇
    * @date 2022/4/22 22:36
    * @return
    */
    @RequestMapping("/pictureThrough")
    public R pictureThrough(@RequestBody MultipartFile file) {
        return ossUtils.uploadFile(file);
    }

}
